package com.kanshu.ksgb.fastread.doudou.app.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;


/**
 * wcy
 * 看书主数据库 维护要多加注意
 */
public class KanShuDbHelper extends SQLiteOpenHelper {

    public static final int CURRENT_VERSION = 1;

    public KanShuDbHelper(Context context) {
        super(context, "kanshu.db", null, CURRENT_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // 创建书架数据表
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        try {
            for (int i = oldVersion; i < newVersion; i++) {
                switch (oldVersion) {
                    case 1:
                        break;
                    // case 2 ...
                    default:
                        break;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            Log.d("wcy", "db upgrade exception:" + e);
        }
    }

    @Override
    public SQLiteDatabase getReadableDatabase() {
        return super.getReadableDatabase();
    }

    @Override
    public SQLiteDatabase getWritableDatabase() {
        return super.getWritableDatabase();
    }


}
